import 'dart:convert' show json;

class ShareFileInfo {

  String? name;
  String? path;

  ShareFileInfo.fromParams({this.name, this.path});

  factory ShareFileInfo(Object jsonStr) => jsonStr is String ? ShareFileInfo.fromJson(json.decode(jsonStr)) : ShareFileInfo.fromJson(jsonStr);

  static ShareFileInfo? parse(jsonStr) => ['null', '', null].contains(jsonStr) ? null : ShareFileInfo(jsonStr);

  ShareFileInfo.fromJson(jsonRes) {
    name = jsonRes['name'];
    path = jsonRes['path'];
  }

  @override
  String toString() {
    return '{"name": ${name != null?'${json.encode(name)}':'null'}, "path": ${path != null?'${json.encode(path)}':'null'}}';
  }

  String toJson() => this.toString();
}